import api from '@/http/index'

/* 列表 */
export const GetGridJsonList = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/MedicalOrdersDTD/GetGridJson', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};

//获取门店列表
export const shopData = (data) => {
    return new Promise((resolve, reject) => {
        api.get('/api/Shop/GetGridJson', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};
//获取会员列表
export const GetUser = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/BaseUsers/GetUser', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};

//获取医院列表
export const HospitalList = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/BaseHospital/HospitalList', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};

//创建陪诊订单
export const CreateNewAccompany = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/MedicalOrdersDTD/CreateNewAccompany', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};
//修改陪诊单
export const OrderEdit = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/MedicalOrdersDTD/OrderEdit', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};
//获取服务
export const GetGridJson = (data) => {
    return new Promise((resolve, reject) => {
        api.get('/api/DTDService/GetGridJson', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};

//获取列表详情
export const GetOrderDetail = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/MedicalOrdersDTD/GetOrderDetail', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};

//获取科室
export const GetSelectJson = (data) => {
    return new Promise((resolve, reject) => {
        api.get('/api/ClientsData/GetSelectJson', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};
// 获取门店下的预约人员
export const GetShopUserList = (data) => {
    return new Promise((resolve, reject) => {
        api.get('/api/MedicalOrdersDTD/GetShopNurseByShopID', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};
// 退款
export const AdRefund = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/MedicalOrdersDTD/AdRefund', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};
// 指派陪诊
export const BindService = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/MedicalOrdersDTD/BindService', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};
// 订单完成
export const OverOrder = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/MedicalOrdersDTD/OverOrder', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};